<form action="../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=msg_del" id="form_del" name="form_del" method="post" style="padding-bottom:20px;">
<table class="from_table2_one">
	<thead>
		<tr class="area_ajax_list_title">
			<th class="pd-left"><tpl> $langSysCADelShort </tpl></th>
			<th><tpl> $langSysCAMsgContent </tpl></th>
			<th><tpl> $langSysCAMsgMember </tpl></th>
			<th><tpl> $langSysCAMsgTime </tpl></th>
			<th><tpl> $langSysCAOperate </tpl></th>
		</tr>
	</thead>
	<tpl> section name=loop loop=$msg_list </tpl>
	<tr>
		<td class="pd-left"><input name="cam_id[]" type="checkbox" value="<tpl> $msg_list[loop].cam_id </tpl>"/></td>
		<td><tpl> $msg_list[loop].cam_content </tpl></td>
		<td><tpl> $msg_list[loop].login_name </tpl></td>
		<td><tpl> $msg_list[loop].cam_time </tpl></td>
		<td>
			<a href="javascript:;" onclick="$('#change_msg_<tpl> $msg_list[loop].cam_id </tpl>').css('display','');"><tpl> $langSysCAMsgModi </tpl></a>
			<a href="javascript:;" onclick="$('#re_msg_<tpl> $msg_list[loop].cam_id </tpl>').css('display','');"><tpl> $langSysCAMsgRe </tpl></a>
		</td>
	</tr>
	<!-- 修改留言 -->
	<tbody id="change_msg_<tpl> $msg_list[loop].cam_id </tpl>" style="display:none; width:100%">
		<tr>
			<td></td>
			<td><tpl> $langSysCAMsgModiContent </tpl></td>
			<td colspan="4">
				<textarea name="cam_change_content_<tpl> $msg_list[loop].cam_id </tpl>" id="cam_change_content_<tpl> $msg_list[loop].cam_id </tpl>" cols="50" rows="6"><tpl> $msg_list[loop].cam_content </tpl></textarea>
			</td>
		</tr>
		<tr>
			<td colspan="6">
				<input type="button" onclick="ajax_change_msg('<tpl> $msg_list[loop].cam_id </tpl>');" value="<tpl> $langSysCAMsgSubmit </tpl>" />
				<input type="button" onclick="$('#change_msg_<tpl> $msg_list[loop].cam_id </tpl>').css('display','none');" value="<tpl> $langSysCAMsgReset </tpl>" />
			</td>
		</tr>
	</tbody>
	<!-- 回复 -->
	<tbody id="re_msg_<tpl> $msg_list[loop].cam_id </tpl>" style="display:none; width:100%">
		<tr>
			<td></td>
			<td><tpl> $langSysCAMsgReContent </tpl></td>
			<td colspan="4">
				<textarea name="cam_re_content_<tpl> $msg_list[loop].cam_id </tpl>" id="cam_re_content_<tpl> $msg_list[loop].cam_id </tpl>" cols="50" rows="6"><tpl> $msg_list[loop].cam_re </tpl></textarea>
			</td>
		</tr>
		<tr>
			<td colspan="6">
				<input type="button" onclick="ajax_re_msg('<tpl> $msg_list[loop].cam_id </tpl>');" value="<tpl> $langSysCAMsgSubmit </tpl>" />
				<input type="button" onclick="$('#re_msg_<tpl> $msg_list[loop].cam_id </tpl>').css('display','none');" value="<tpl> $langSysCAMsgReset </tpl>" />
			</td>
		</tr>
	</tbody>
	<tpl> /section </tpl>
	
</table>

<div class="table-5-bottom"><div class="p-left">
				<span class="btn_left"><input id="selectall" name="selectall" value="<tpl> $langSysCASelAll </tpl>" class="btn_submit" type="button"/></span>
				<span class="btn_left"><input id="delbutton" name="delbutton" value="<tpl> $langSysCADel </tpl>" class="btn_submit" type="button"/></span>
				<span class="btn_left"><input type="button" name="return_button" id="return_button" class="btn_submit" value="<tpl> $langSysCAReturnList </tpl>" /></span>
			</div>
			<div style="float:right; padding-right:20px"><tpl> $page_list </tpl></div></div>
</form>
<div id="question" style="display:none; cursor: default; padding:10px"> 
        <b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-top:10px; padding-bottom:10px"><tpl> $langSysCADelConfirm </tpl></b> <br />
        <input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
        <input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
</div> 
<script>
$(document).ready(function() {
	hideLoading();
	
	$('#selectall').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	
	$('#return_button').click(
		function(){
			ShowDiv	= 'result_content';
			getPageContent("../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=ajax_list&curpage=<tpl>$curpage</tpl>");
		}
	);
	
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
			if(msg.type == '1'){
				ShowDiv = "result_content";
				getPageContent("../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=msg_list&id=<tpl> $ca_id </tpl><tpl>if $msg_list|@count neq 1</tpl>&curpage=<tpl>$curpage</tpl><tpl>/if</tpl>");
			}
		},
		type:      'get',
		dataType:  'json'
	};
	
	var question = $('#question')[0];
	$("#delbutton").click(function(){
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
			$.unblockUI();
			$('#form_del').ajaxSubmit(options);	
			return false;
		});
	$('#no').click($.unblockUI);
});

//修改留言
function ajax_change_msg(id){
	$.ajax({
		url: "../app/<tpl> $app_module.app_module_sign </tpl>/system.php",
		data: "action=msg_update&id="+id+"&cam_change_content="+$('#cam_change_content_'+id).val(),
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showText),
		success: function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
			if(msg.type == '1'){
				ShowDiv = "result_content";
				getPageContent("../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=msg_list&id=<tpl> $ca_id </tpl>&<tpl>if $msg_list|@count neq 1</tpl>&curpage=<tpl>$curpage</tpl><tpl>/if</tpl>");
			}
		}
	});
	return false;
}

//回复留言
function ajax_re_msg(id){
	$.ajax({
		url: "../app/<tpl> $app_module.app_module_sign </tpl>/system.php",
		data: "action=msg_re&id="+id+"&cam_re_content="+$('#cam_re_content_'+id).val(),
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showText),
		success: function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
			if(msg.type == '1'){
				ShowDiv = "result_content";
				getPageContent("../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=msg_list&id=<tpl> $ca_id </tpl>&<tpl>if $msg_list|@count neq 1</tpl>&curpage=<tpl>$curpage</tpl><tpl>/if</tpl>");
			}
		}
	});
	return false;
}
</script>
</html>
